﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.User.TransferAccountModel>" %>
<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	转账支付明细
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
    <% Html.BeginForm("transferaccount","user"); %>
    <table width="100%" class="table">
        <tr class="th"><th colspan="6" align="left">&nbsp;&nbsp;搜索条件</th></tr>
        <tr>
            <td>
                订单号:<%=Html.TextBoxFor(p => p.Serch.Order, new { @class="width120"})%>
                <%=Html.ValidationMessageFor(p=>p.Serch.Order) %>
            </td>
            <td>
                用户名:<%=Html.TextBoxFor(p => p.Serch.UserName, new { @class="text80"})%>
                <%=Html.ValidationMessageFor(p=>p.Serch.UserName) %>
            </td>
            <td>
                状态:<%=Html.DropDownListFor(p => p.Serch.Result, Model.Results) %>
                <%=Html.ValidationMessageFor(p=>p.Serch.Result) %>
            </td>
            <td>
                日期从:<input type="text" class="width80" onclick="WdatePicker()" id="Serch_StartTime" name="Serch.StartTime" value='<%=string.Format("{0:yyyy-MM-dd}",Model.Serch.StartTime) %>' />
                <%=Html.ValidationMessageFor(p=>p.Serch.StartTime) %>
            </td>
            <td>
                至:<input type="text" class="width80" onclick="WdatePicker()" id="Serch_EndTime" name="Serch.EndTime" value='<%=string.Format("{0:yyyy-MM-dd}",Model.Serch.EndTime) %>' />
                <%=Html.ValidationMessageFor(p=>p.Serch.EndTime) %>
            </td>
            <td>
                <input type="submit" id="SerchTransferAccount" name="SerchTransferAccount" value="查找" />
            </td>
        </tr>
        <tr>
            <td>
                平台ID:<%=Html.TextBoxFor(p => p.Serch.SiteID, new { @class = "width100" }) %>
            </td>
            <td colspan="5" style="padding:0px;">
                <table width="100%" class="table">
                    <tr>
                        <td>
                            返馈费率:<%=Model.ChargeRatio.HasValue ? Model.ChargeRatio + "%" : "" %>
                            <%=Model.MinRatio.HasValue ? "最小:" + Model.MinRatio.ToString("F2") + "元" : ""%>
                            <%=Model.MaxRatio.HasValue ? "最大:" + Model.MaxRatio.ToString("F2") + "元" : "" %>
                        </td>
                        <td align="left">
                            订单号<%=Html.TextBoxFor(p=>p.OrderID,new{ @class="width120"}) %>
                            <%=Html.ValidationMessageFor(p=>p.OrderID) %>
                            不包括平台ID
                        </td>
                        <td align="center">
                            <input id="ConfirmTransferAccount" type="submit" name="ConfirmTransferAccount" value="确认"
                                onclick=" if($('#OrderID').is('.valid'))return confirm('您确定已收到该订单的转账吗？\r\n确认后将不可回滚。');else alert('请输入正确的订单号');return false; " />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    
    <%=Html.HiddenFor(p=>p.PageSize) %>
    <p />
    <table width="100%" class="table">
        <tr class="th"><th>订单号</th><th>用户名</th><th>充值金额</th><th>添加时间</th><th>状态</th><th>确认时间</th><th>操作员</th></tr>
        <% foreach(var item in Model.Datas) %>
        <% { %>
        <tr>
            <td><%=string.IsNullOrEmpty(item.SiteID) ? "" : item.SiteID + "-" %><%=item.OrderID %></td>
            <td><%=item.UserName %></td>
            <td><%=item.Money.ToString("F2") %></td>
            <td><%=item.AddTime %></td>
            <td><%=item.Result.GetName() %></td>
            <td><%=item.SuccesTime %></td>
            <td><%=item.Result == PayResult.WatingPay ? "<input type='submit' name='RevocationTransferAccount' value='撤销' onclick='return RevocationOrder(\"" + (string.IsNullOrEmpty(item.SiteID) ? "" : item.OrderID.ToString()) + "\")'/>"
                :item.Admin %>
                <%=item.Result==PayResult.WatingPay?"<input type='submit' name='ConfirmTransferAccount' value='确认' onclick='return submitOrder(\""+(string.IsNullOrEmpty(item.SiteID) ? "" : item.OrderID.ToString())+"\")'/>"
                :item.Admin %></td>
        </tr>
        <% } %>
        <tr>
            <td colspan="7"><%=Html.Pager(Model.Page.Value,Model.PageSize.Value,Model.SumCount,"page",Url.Route(new{Model.Serch}),"pagesize") %></td>
        </tr>
    </table>
    <% Html.EndForm(); %>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
<style type="text/css">
    .width300{width:300px;}
</style>
<script type="text/javascript">
    function submitOrder(id) {
        if (id == '')
            return false;
        if (!confirm('您确定已收到该订单的转账吗？\r\n确认后将不可回滚。'))
            return false;
        $('.table #OrderID').val(id);
        return true;
    }
</script>
<script type="text/javascript">
    function RevocationOrder(id) {
        if (id == '')
            return false;
        if (!confirm('您确定撤销该订单的转账吗？\r\n撤销后将不可回滚。'))
            return false;
        $('.table #OrderID').val(id);
        return true;
    }
</script>
</asp:Content>
